//
// Created by lsm on 2021/3/17.
//

#ifndef MUDUO_COUNTER_H
#define MUDUO_COUNTER_H

#include <boost/noncopyable.hpp>
#include <mutex>

class Counter : boost::noncopyable
{
public:
    Counter():value_(0){}

    int64_t value() const;

    int64_t getAndIncrease();

private:
    int64_t value_;
    mutable std::mutex mutex_;
};

#endif //MUDUO_COUNTER_H
